<?php use_stylesheets_for_form($form) ?>
<?php use_javascripts_for_form($form) ?>

<form action="<?php echo url_for('mail/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?mail_id='.$form->getObject()->getMailId() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
<?php if (!$form->getObject()->isNew()): ?>
<input type="hidden" name="sf_method" value="put" />
<?php endif; ?>
  <table>
    <tfoot>
      <tr>
        <td colspan="2">
          <?php echo $form->renderHiddenFields(false) ?>
          &nbsp;<a href="<?php echo url_for('mail/index') ?>">Back to list</a>
          <?php if (!$form->getObject()->isNew()): ?>
            &nbsp;<?php echo link_to('Delete', 'mail/delete?mail_id='.$form->getObject()->getMailId(), array('method' => 'delete', 'confirm' => 'Are you sure?')) ?>
          <?php endif; ?>
          <input type="submit" value="Save" />
        </td>
      </tr>
    </tfoot>
    <tbody>
      <?php echo $form->renderGlobalErrors() ?>
      <tr>
        <th><?php echo $form['campaign_id']->renderLabel() ?></th>
        <td>
          <?php echo $form['campaign_id']->renderError() ?>
          <?php echo $form['campaign_id'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['template_id']->renderLabel() ?></th>
        <td>
          <?php echo $form['template_id']->renderError() ?>
          <?php echo $form['template_id'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['recipient_id']->renderLabel() ?></th>
        <td>
          <?php echo $form['recipient_id']->renderError() ?>
          <?php echo $form['recipient_id'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['recipient']->renderLabel() ?></th>
        <td>
          <?php echo $form['recipient']->renderError() ?>
          <?php echo $form['recipient'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['recipeint_name']->renderLabel() ?></th>
        <td>
          <?php echo $form['recipeint_name']->renderError() ?>
          <?php echo $form['recipeint_name'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['cc']->renderLabel() ?></th>
        <td>
          <?php echo $form['cc']->renderError() ?>
          <?php echo $form['cc'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['ccn']->renderLabel() ?></th>
        <td>
          <?php echo $form['ccn']->renderError() ?>
          <?php echo $form['ccn'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['from_address']->renderLabel() ?></th>
        <td>
          <?php echo $form['from_address']->renderError() ?>
          <?php echo $form['from_address'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['from_name']->renderLabel() ?></th>
        <td>
          <?php echo $form['from_name']->renderError() ?>
          <?php echo $form['from_name'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['subject']->renderLabel() ?></th>
        <td>
          <?php echo $form['subject']->renderError() ?>
          <?php echo $form['subject'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['text']->renderLabel() ?></th>
        <td>
          <?php echo $form['text']->renderError() ?>
          <?php echo $form['text'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['html']->renderLabel() ?></th>
        <td>
          <?php echo $form['html']->renderError() ?>
          <?php echo $form['html'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['attachment']->renderLabel() ?></th>
        <td>
          <?php echo $form['attachment']->renderError() ?>
          <?php echo $form['attachment'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['attachment_name']->renderLabel() ?></th>
        <td>
          <?php echo $form['attachment_name']->renderError() ?>
          <?php echo $form['attachment_name'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['attachment_type']->renderLabel() ?></th>
        <td>
          <?php echo $form['attachment_type']->renderError() ?>
          <?php echo $form['attachment_type'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['sent_date']->renderLabel() ?></th>
        <td>
          <?php echo $form['sent_date']->renderError() ?>
          <?php echo $form['sent_date'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['status']->renderLabel() ?></th>
        <td>
          <?php echo $form['status']->renderError() ?>
          <?php echo $form['status'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['notes']->renderLabel() ?></th>
        <td>
          <?php echo $form['notes']->renderError() ?>
          <?php echo $form['notes'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['created_at']->renderLabel() ?></th>
        <td>
          <?php echo $form['created_at']->renderError() ?>
          <?php echo $form['created_at'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['updated_at']->renderLabel() ?></th>
        <td>
          <?php echo $form['updated_at']->renderError() ?>
          <?php echo $form['updated_at'] ?>
        </td>
      </tr>
    </tbody>
  </table>
</form>
